package(default_visibility=["//visibility:public"])
load("@angular//:index.bzl", "ng_module")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")


ng_module(
  name = "card",
  srcs = glob(["**/*.ts"], exclude=["**/*.spec.ts"]),
  module_name = "@angular/material/card",
  assets = [":card_css"] + glob(["**/*.html"]),
  deps = [
    "//src/lib/core",
  ],
  tsconfig = "//src/lib:tsconfig-build.json",
)

# TODO(jelbourn): replace this w/ sass_library when it supports acting like a filegroup
filegroup(
  name = "card_scss_partials",
  srcs = glob(["**/_*.scss"]),
)

sass_binary(
  name = "card_scss",
  src = "card.scss",
  deps = ["//src/lib/core:core_scss_lib"],
)

# TODO(jelbourn): remove this when sass_binary supports specifying an output filename and dir.
# Copy the output of the sass_binary such that the filename and path match what we expect.
genrule(
  name = "card_css",
  srcs = [":card_scss.css"],
  outs = ["card.css"],
  cmd = "cp $< $@",
)

sass_library(
  name = "theme",
  srcs = glob(["**/*-theme.scss"]),
)
